<?php
	header('Content-type: application/json');	
	require_once 'application/dataAccess.php';
	$da = new dataAccess();
	$result = $da->getAllTerms();
	$terms = "";		
	while($row = mysql_fetch_array($result))
	{	
		$terms .= '"' . str_replace("\"", "\\\"", strtolower($row["term"])) . '",';
	}
	$terms = trim($terms, ",");	
	$data = '{"terms": ['. $terms .']}';	
	echo  $data;
?>